<!--
author: 何其沆(pooky)
desc: Contract - Detail
date: 2021-11-12
-->
<template>
  <e-container>
    <div class="contract-detail">
      <div v-if="noticeShow" class="contract-detail-notice">
        <span>合同即将到期</span>
        <e-icon type="error" color="#818d9f" font-size="20px" style="cursor: pointer" @click="closeNotice" />
      </div>
      <div class="contract-detail-main">
        <div class="main-list">
          <div class="list-item-title">Contract Name</div>
          <div class="list-item-content">杰克森医疗产品翻译项目</div>
        </div>
        <div class="main-list">
          <div class="list-area">
            <div class="list-item-title">Client Name</div>
            <div class="list-item-content">杰克森沈阳分部销售门店</div>
          </div>
          <div class="list-area">
            <div class="list-item-title">客户状态</div>
            <div class="list-item-content">Target Clients</div>
          </div>
        </div>
        <div class="main-list">
          <div class="list-area">
            <div class="list-item-title">Contract Number</div>
            <div class="list-item-content">09AB7345968720210930</div>
          </div>
          <div class="list-area">
            <div class="list-item-title">Type</div>
            <div class="list-item-content">Other</div>
          </div>
        </div>
        <div class="main-list">
          <div class="list-area">
            <div class="list-item-title">Start Date</div>
            <div class="list-item-content">2020-09-19</div>
          </div>
          <div class="list-area">
            <div class="list-item-title">End Date</div>
            <div class="list-item-content">
              2020-09-19
              <span class="renewal">自动续约</span>
            </div>
          </div>
        </div>
        <div class="main-list">
          <div class="list-area">
            <div class="list-item-title">Created By</div>
            <div class="list-item-content">sh_Jean[李进菡]</div>
          </div>
          <div class="list-area">
            <div class="list-item-title">Created On</div>
            <div class="list-item-content">2020-09-19</div>
          </div>
        </div>
        <div class="main-list" style="height: 80px">
          <div class="list-item-title">Note</div>
          <div class="list-item-content">
            杰克森医疗产品翻译项目合同文本杰克森医疗产品翻译项目合同文本杰克森医疗产品翻译项目合同文本杰克森医疗产品翻译项目合同文本杰克森医疗产品翻译项目合同文本
          </div>
        </div>
        <div class="main-list">
          <div class="list-item-title">Attachment</div>
          <div class="list-item-content pdf" @click="download">
            <span class="pdf-down">
              <PaperClipOutlined style="color: rgba(107, 121, 142, 0.85)" /> 杰克森医疗产品翻译项目合同文本.pdf
            </span>
          </div>
        </div>
      </div>
    </div>
    <Teleport to="#title-left-teleport-from-child">
      <div class="back-area">
        <span class="back" @click="handleBack">
          <e-icon type="Aright" color="#3c6cfe"></e-icon>
        </span>
        <div class="info">
          <e-icon type="contract_detail" color="rgba(107, 121, 142, 0.85)"></e-icon>
          <span>09AB7345968720210930</span>
        </div>
      </div>
    </Teleport>
    <Teleport to="#title-right-teleport-from-child">
      <div class="operation">
        <div class="operation-item" style="margin-right: 24px" @click="handleDelete">
          <e-icon type="delete" color="#fc4b3b" style="margin-top: 4px; margin-right: 6px"></e-icon>
          <span style="color: #fc4b3b">Delete</span>
        </div>
        <div class="operation-item" style="color: #3c6cfe" @click="handleEdit">
          <e-icon type="edit" color="#3c6cfe" style="margin-top: 4px; margin-right: 6px"></e-icon>
          <span style="color: #3c6cfe">Edit</span>
        </div>
      </div>
    </Teleport>
  </e-container>
</template>

<script setup>
import { ref } from 'vue'
import { PaperClipOutlined } from '@ant-design/icons-vue'
import EContainer from '@/components/EContainer.vue'
import EIcon from '@/components/EIcon.vue'

const emits = defineEmits(['back'])

// 是否显示提示
const noticeShow = ref(true)
/**
 * 关闭提示
 */
const closeNotice = () => {
  noticeShow.value = false
}
/**
 * 删除
 */
const handleDelete = () => {}
/**
 * 修改
 */
const handleEdit = () => {}
/**
 * 下载
 */
const download = () => {}
/**
 * 返回
 */
const handleBack = () => emits('back')
</script>

<style scoped lang="less">
.contract-detail {
  width: 100%;
  padding-bottom: 6px;
  box-sizing: border-box;
  .contract-detail-notice {
    width: 100%;
    height: 40px;
    border-top: 1px solid @border-color;
    background-color: #fffaef;
    padding: 0 12px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  .contract-detail-main {
    width: 100%;
    border: 1px solid @border-color;
    .main-list {
      width: 100%;
      height: 40px;
      border-bottom: 1px solid @border-color;
      display: flex;
      box-sizing: border-box;
      .list-area {
        width: 50%;
        border-right: 1px solid @border-color;
        display: flex;
      }
      .list-item-title {
        width: 224px;
        height: 100%;
        border-right: 1px solid @border-color;
        color: @deep-gray;
        padding-top: 10px;
        padding-left: 12px;
        background-color: @milk;
      }
      .list-item-content {
        flex: 1;
        color: @black-85p;
        padding-top: 10px;
        padding-left: 12px;
        .renewal {
          background-color: @phase-default;
          border-radius: 2px;
          font-size: 12px;
          color: @deep-gray;
          padding: 2px 4px;
          margin-left: 10px;
        }
      }
      .pdf {
        color: @primary-color;
        font-size: 14px;
        line-height: 22px;
        cursor: pointer;
        .pdf-down {
          padding: 2px 8px;
          background-color: @phase-default;
        }
      }
      &:last-child {
        border-bottom: none;
      }
    }
  }
}
.back-area {
  display: flex;
  align-items: center;
  width: 300px;
  padding-top: 4px;
  .back {
    display: inline-block;
    border: 1px solid @border-color;
    width: 24px;
    height: 24px;
    text-align: center;
    line-height: 22px;
    cursor: pointer;
  }
  .info {
    color: @text-gray;
    margin-left: 20px;
    span {
      margin-left: 6px;
      font-weight: 700;
      font-size: 14px;
    }
  }
}
.operation {
  display: flex;
  .operation-item {
    display: flex;
    align-items: center;
    cursor: pointer;
    span {
      font-weight: normal;
      font-size: 14px;
    }
  }
}
</style>
